'gtkmountoperationprivate.h',
'gtknativedialogprivate.h',
'gtknomediafileprivate.h',
- 'gtkorientableprivate.h',
'gtkplacessidebarprivate.h',
'gtkplacesviewprivate.h',
'gtkplacesviewrowprivate.h',
#include "gtkcsspositionvalueprivate.h"
#include "gtkintl.h"
#include "gtkorientable.h"
-#include "gtkorientableprivate.h"
#include "gtkprivate.h"
#include "gtktypebuiltins.h"
#include "gtksizerequest.h"
priv->orientation = orientation;
gtk_orientable_set_orientation (GTK_ORIENTABLE (box_layout),
priv->orientation);
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (box));
+ gtk_widget_update_orientation (GTK_WIDGET (box), priv->orientation);
g_object_notify (object, "orientation");
}
}
GtkBoxPrivate *priv = gtk_box_get_instance_private (box);
priv->orientation = GTK_ORIENTATION_HORIZONTAL;
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (box));
+ gtk_widget_update_orientation (GTK_WIDGET (box), priv->orientation);
}
static GtkBuildableIface *parent_buildable_iface;
#include "gtkcsspositionvalueprivate.h"
#include "gtkintl.h"
-#include "gtkorientableprivate.h"
+#include "gtkorientable.h"
#include "gtkprivate.h"
#include "gtksizerequest.h"
#include "gtkstylecontextprivate.h"
widget = gtk_layout_manager_get_widget (layout_manager);
if (widget != NULL && GTK_IS_ORIENTABLE (widget))
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (widget));
+ gtk_widget_update_orientation (widget, self->orientation);
gtk_layout_manager_layout_changed (layout_manager);
*/
#include "config.h"
-#include <string.h>
+
#include "gtkcellview.h"
+
+#include "gtkbuildable.h"
#include "gtkcelllayout.h"
#include "gtkcellareabox.h"
-#include "gtkintl.h"
-#include "gtkcellrenderertext.h"
#include "gtkcellrendererpixbuf.h"
+#include "gtkcellrenderertext.h"
+#include "gtkintl.h"
+#include "gtkorientable.h"
#include "gtkprivate.h"
-#include "gtkorientableprivate.h"
#include "gtkwidgetprivate.h"
+
#include <gobject/gmarshal.h>
-#include "gtkbuildable.h"
+#include <string.h>
/**
* SECTION:gtkcellview
priv->orientation = g_value_get_enum (value);
if (priv->context)
gtk_cell_area_context_reset (priv->context);
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (object));
+ gtk_widget_update_orientation (GTK_WIDGET (object), priv->orientation);
g_object_notify_by_pspec (object, pspec);
}
break;
#include "gtkcssnodeprivate.h"
#include "gtkwidgetprivate.h"
#include "gtkorientable.h"
-#include "gtkorientableprivate.h"
#include "gtkbuildable.h"
#include "gtksizerequest.h"
#include "gtktypebuiltins.h"
if (current != orientation)
{
gtk_center_layout_set_orientation (GTK_CENTER_LAYOUT (layout), orientation);
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (self));
+ gtk_widget_update_orientation (GTK_WIDGET (self), orientation);
gtk_widget_queue_resize (GTK_WIDGET (self));
g_object_notify (object, "orientation");
}
#include <config.h>
-#include "gtkflowbox.h"
#include "gtkflowboxprivate.h"
#include "gtkadjustment.h"
#include "gtkbuildable.h"
#include "gtkcsscolorvalueprivate.h"
#include "gtkcssnodeprivate.h"
-#include "gtkgesturedrag.h"
+#include "gtkeventcontrollerkey.h"
#include "gtkgestureclick.h"
+#include "gtkgesturedrag.h"
#include "gtkintl.h"
#include "gtkmain.h"
#include "gtkmarshalers.h"
+#include "gtkorientable.h"
#include "gtkprivate.h"
-#include "gtkorientableprivate.h"
#include "gtkrender.h"
#include "gtksizerequest.h"
#include "gtksnapshot.h"
#include "gtktypebuiltins.h"
#include "gtkviewport.h"
#include "gtkwidgetprivate.h"
-#include "gtkeventcontrollerkey.h"
#include "a11y/gtkflowboxaccessibleprivate.h"
#include "a11y/gtkflowboxchildaccessible.h"
switch (prop_id)
{
case PROP_ORIENTATION:
- if (priv->orientation != g_value_get_enum (value))
- {
- priv->orientation = g_value_get_enum (value);
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (box));
- /* Re-box the children in the new orientation */
- gtk_widget_queue_resize (GTK_WIDGET (box));
- g_object_notify_by_pspec (object, pspec);
- }
+ {
+ GtkOrientation orientation = g_value_get_enum (value);
+
+ if (priv->orientation != orientation)
+ {
+ priv->orientation = orientation;
+
+ gtk_widget_update_orientation (GTK_WIDGET (box), priv->orientation);
+
+ /* Re-box the children in the new orientation */
+ gtk_widget_queue_resize (GTK_WIDGET (box));
+ g_object_notify_by_pspec (object, pspec);
+ }
+ }
break;
case PROP_HOMOGENEOUS:
gtk_flow_box_set_homogeneous (box, g_value_get_boolean (value));
priv->row_spacing = 0;
priv->activate_on_single_click = TRUE;
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (box));
+ gtk_widget_update_orientation (GTK_WIDGET (box), priv->orientation);
priv->children = g_sequence_new (NULL);
#include "gtkbuildable.h"
#include "gtkcsspositionvalueprivate.h"
#include "gtkgridlayout.h"
-#include "gtkorientableprivate.h"
#include "gtkintl.h"
+#include "gtkorientable.h"
#include "gtkprivate.h"
#include "gtksizerequest.h"
#include "gtkstylecontextprivate.h"
if (priv->orientation != orientation)
{
priv->orientation = orientation;
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (grid));
+
+ gtk_widget_update_orientation (GTK_WIDGET (grid), priv->orientation);
g_object_notify (G_OBJECT (grid), "orientation");
}
priv->layout_manager = gtk_widget_get_layout_manager (GTK_WIDGET (grid));
priv->orientation = GTK_ORIENTATION_HORIZONTAL;
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (grid));
+ gtk_widget_update_orientation (GTK_WIDGET (grid), priv->orientation);
}
/**
#include "gtkdebug.h"
#include "gtkintl.h"
#include "gtklayoutchild.h"
-#include "gtkorientableprivate.h"
+#include "gtkorientable.h"
#include "gtkprivate.h"
#include "gtksizerequest.h"
#include "gtkstylecontextprivate.h"
#include "gtkbinlayout.h"
#include "gtkbuildable.h"
#include "gtkbuilderprivate.h"
+#include "gtkcssstylepropertyprivate.h"
+#include "gtkcssnodeprivate.h"
+#include "gtkgizmoprivate.h"
#include "gtkintl.h"
-#include "gtkorientableprivate.h"
#include "gtklevelbar.h"
#include "gtkmarshalers.h"
-#include "gtkstylecontext.h"
+#include "gtkorientable.h"
+#include "gtkstylecontextprivate.h"
#include "gtktypebuiltins.h"
-#include "gtkwidget.h"
#include "gtkwidgetprivate.h"
-#include "gtkstylecontextprivate.h"
-#include "gtkcssstylepropertyprivate.h"
-#include "gtkcssnodeprivate.h"
-#include "gtkgizmoprivate.h"
#include <math.h>
#include <stdlib.h>
if (self->orientation != orientation)
{
self->orientation = orientation;
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (self));
+ gtk_widget_update_orientation (GTK_WIDGET (self), self->orientation);
gtk_widget_queue_resize (GTK_WIDGET (self));
g_object_notify (G_OBJECT (self), "orientation");
}
/* set initial orientation and style classes */
self->orientation = GTK_ORIENTATION_HORIZONTAL;
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (self));
+ gtk_widget_update_orientation (GTK_WIDGET (self), self->orientation);
self->inverted = FALSE;
#include "gtklistbaseprivate.h"
#include "gtkadjustment.h"
+#include "gtkgesturedrag.h"
+#include "gtkgizmoprivate.h"
#include "gtkintl.h"
#include "gtklistitemwidgetprivate.h"
-#include "gtkorientableprivate.h"
+#include "gtkmultiselection.h"
+#include "gtkorientable.h"
#include "gtkscrollable.h"
+#include "gtkset.h"
#include "gtksingleselection.h"
+#include "gtksnapshot.h"
+#include "gtkstylecontextprivate.h"
#include "gtktypebuiltins.h"
-#include "gtkgesturedrag.h"
#include "gtkwidgetprivate.h"
-#include "gtkstylecontextprivate.h"
-#include "gtksnapshot.h"
-#include "gtkmultiselection.h"
-#include "gtkgizmoprivate.h"
-#include "gtkset.h"
typedef struct _RubberbandData RubberbandData;
if (priv->orientation != orientation)
{
priv->orientation = orientation;
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (self));
+ gtk_widget_update_orientation (GTK_WIDGET (self), priv->orientation);
gtk_widget_queue_resize (GTK_WIDGET (self));
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_ORIENTATION]);
}
#include "config.h"
-#include "gtkorientableprivate.h"
+#include "gtkorientable.h"
#include "gtkprivate.h"
+#include "gtkwidgetprivate.h"
#include "gtkstylecontext.h"
#include "gtktypebuiltins.h"
#include "gtkintl.h"
NULL);
if (GTK_IS_WIDGET (orientable))
- _gtk_orientable_set_style_classes (orientable);
+ gtk_widget_update_orientation (GTK_WIDGET (orientable), orientation);
}
/**
return orientation;
}
-
-void
-_gtk_orientable_set_style_classes (GtkOrientable *orientable)
-{
- GtkOrientation orientation;
-
- g_return_if_fail (GTK_IS_ORIENTABLE (orientable));
- g_return_if_fail (GTK_IS_WIDGET (orientable));
-
- orientation = gtk_orientable_get_orientation (orientable);
-
- if (orientation == GTK_ORIENTATION_HORIZONTAL)
- {
- gtk_widget_add_css_class (GTK_WIDGET (orientable), GTK_STYLE_CLASS_HORIZONTAL);
- gtk_widget_remove_css_class (GTK_WIDGET (orientable), GTK_STYLE_CLASS_VERTICAL);
- }
- else
- {
- gtk_widget_add_css_class (GTK_WIDGET (orientable), GTK_STYLE_CLASS_VERTICAL);
- gtk_widget_remove_css_class (GTK_WIDGET (orientable), GTK_STYLE_CLASS_HORIZONTAL);
- }
-}
+++ /dev/null
-/* GTK - The GIMP Toolkit
- * Copyright (C) 2011 Red Hat, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef __GTK_ORIENTABLE_PRIVATE_H__
-#define __GTK_ORIENTABLE_PRIVATE_H__
-
-#include "gtkorientable.h"
-
-G_BEGIN_DECLS
-
-void _gtk_orientable_set_style_classes (GtkOrientable *orientable);
-
-G_END_DECLS
-
-#endif /* __GTK_ORIENTABLE_H__ */
#include "gtkpaned.h"
+#include "gtkcssboxesprivate.h"
#include "gtkcssnodeprivate.h"
#include "gtkcssstylepropertyprivate.h"
#include "gtkeventcontrollermotion.h"
#include "gtkgizmoprivate.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
-#include "gtkorientableprivate.h"
+#include "gtkorientable.h"
#include "gtkprivate.h"
#include "gtkrendericonprivate.h"
#include "gtkstylecontextprivate.h"
GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
}
+static void
+gtk_paned_set_orientation (GtkPaned *self,
+ GtkOrientation orientation)
+{
+ if (self->orientation != orientation)
+ {
+ static const char *cursor_name[2] = {
+ "col-resize",
+ "row-resize",
+ };
+
+ self->orientation = orientation;
+
+ gtk_widget_update_orientation (GTK_WIDGET (self), self->orientation);
+ gtk_widget_set_cursor_from_name (self->handle_widget,
+ cursor_name[orientation]);
+ gtk_gesture_pan_set_orientation (GTK_GESTURE_PAN (self->pan_gesture),
+ orientation);
+
+ gtk_widget_queue_resize (GTK_WIDGET (self));
+ g_object_notify (G_OBJECT (self), "orientation");
+ }
+}
+
static void
gtk_paned_class_init (GtkPanedClass *class)
{
switch (prop_id)
{
case PROP_ORIENTATION:
- if (paned->orientation != g_value_get_enum (value))
- {
- paned->orientation = g_value_get_enum (value);
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (paned));
-
- if (paned->orientation == GTK_ORIENTATION_HORIZONTAL)
- {
- gtk_gesture_pan_set_orientation (GTK_GESTURE_PAN (paned->pan_gesture),
- GTK_ORIENTATION_HORIZONTAL);
- gtk_widget_set_cursor_from_name (paned->handle_widget,
- "col-resize");
- }
- else
- {
- gtk_gesture_pan_set_orientation (GTK_GESTURE_PAN (paned->pan_gesture),
- GTK_ORIENTATION_VERTICAL);
- gtk_widget_set_cursor_from_name (paned->handle_widget,
- "row-resize");
- }
-
- gtk_widget_queue_resize (GTK_WIDGET (paned));
- g_object_notify_by_pspec (object, pspec);
- }
+ gtk_paned_set_orientation (paned, g_value_get_enum (value));
break;
case PROP_POSITION:
gtk_paned_set_position (paned, g_value_get_int (value));
paned->shrink_start_child = TRUE;
paned->shrink_end_child = TRUE;
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (paned));
+ gtk_widget_update_orientation (GTK_WIDGET (paned), paned->orientation);
/* Touch gesture */
gesture = gtk_gesture_pan_new (GTK_ORIENTATION_HORIZONTAL);
#include "gtkprogressbar.h"
+#include "gtkboxlayout.h"
#include "gtkcssnodeprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcssstylepropertyprivate.h"
#include "gtkgizmoprivate.h"
#include "gtkintl.h"
#include "gtklabel.h"
-#include "gtkorientableprivate.h"
+#include "gtkorientable.h"
#include "gtkprogresstrackerprivate.h"
#include "gtkprivate.h"
#include "gtkstylecontextprivate.h"
#include "gtkwidgetprivate.h"
-#include "gtkboxlayout.h"
#include "a11y/gtkprogressbaraccessible.h"
/* horizontal is default */
pbar->orientation = GTK_ORIENTATION_VERTICAL; /* Just to force an update... */
gtk_progress_bar_set_orientation (pbar, GTK_ORIENTATION_HORIZONTAL);
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (pbar));
+ gtk_widget_update_orientation (GTK_WIDGET (pbar), pbar->orientation);
}
static void
gtk_widget_set_valign (pbar->trough_widget, GTK_ALIGN_FILL);
}
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (pbar));
+ gtk_widget_update_orientation (GTK_WIDGET (pbar), pbar->orientation);
update_node_classes (pbar);
layout = GTK_BOX_LAYOUT (gtk_widget_get_layout_manager (GTK_WIDGET (pbar)));
#include "gtkadjustmentprivate.h"
#include "gtkcolorscaleprivate.h"
+#include "gtkeventcontrollerkey.h"
#include "gtkeventcontrollerscroll.h"
#include "gtkgesturedrag.h"
#include "gtkgesturelongpressprivate.h"
#include "gtkgizmoprivate.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
-#include "gtkorientableprivate.h"
+#include "gtkorientable.h"
#include "gtkprivate.h"
#include "gtkscale.h"
#include "gtktypebuiltins.h"
-#include "gtkeventcontrollerkey.h"
+#include "gtkwidgetprivate.h"
#include "a11y/gtkrangeaccessible.h"
if (priv->orientation != g_value_get_enum (value))
{
priv->orientation = g_value_get_enum (value);
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (range));
+ gtk_widget_update_orientation (GTK_WIDGET (range), priv->orientation);
gtk_widget_queue_resize (GTK_WIDGET (range));
g_object_notify_by_pspec (object, pspec);
}
priv->fill_level = G_MAXDOUBLE;
priv->timer = NULL;
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (range));
+ gtk_widget_update_orientation (GTK_WIDGET (range), priv->orientation);
priv->trough_widget = gtk_gizmo_new ("trough",
gtk_range_measure_trough,
#include "gtkadjustment.h"
#include "gtkintl.h"
#include "gtkorientable.h"
-#include "gtkorientableprivate.h"
#include "gtkprivate.h"
#include "gtkwidgetprivate.h"
#include "gtkboxlayout.h"
gtk_orientable_set_orientation (GTK_ORIENTABLE (layout), orientation);
gtk_orientable_set_orientation (GTK_ORIENTABLE (priv->range), orientation);
priv->orientation = orientation;
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (self));
-
+ gtk_widget_update_orientation (GTK_WIDGET (self), priv->orientation);
gtk_widget_queue_resize (GTK_WIDGET (self));
g_object_notify_by_pspec (object, pspec);
}
gtk_widget_set_hexpand (priv->range, TRUE);
gtk_widget_set_vexpand (priv->range, TRUE);
gtk_widget_set_parent (priv->range, GTK_WIDGET (self));
-
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (self));
+ gtk_widget_update_orientation (GTK_WIDGET (self), priv->orientation);
}
/**
#include "gtkseparator.h"
-#include "gtkorientableprivate.h"
#include "gtkintl.h"
+#include "gtkorientable.h"
#include "gtkprivate.h"
#include "gtkwidgetprivate.h"
if (separator->orientation != g_value_get_enum (value))
{
separator->orientation = g_value_get_enum (value);
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (object));
+ gtk_widget_update_orientation (GTK_WIDGET (object),
+ separator->orientation);
gtk_widget_queue_resize (GTK_WIDGET (object));
g_object_notify_by_pspec (object, pspec);
}
{
separator->orientation = GTK_ORIENTATION_HORIZONTAL;
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (separator));
+ gtk_widget_update_orientation (GTK_WIDGET (separator),
+ separator->orientation);
}
static void
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkorientable.h"
-#include "gtkorientableprivate.h"
#include "gtkprivate.h"
#include "gtksettings.h"
#include "gtkstylecontextprivate.h"
spin_button->orientation = GTK_ORIENTATION_HORIZONTAL;
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (spin_button));
+ gtk_widget_update_orientation (GTK_WIDGET (spin_button),
+ spin_button->orientation);
spin_button->entry = gtk_text_new ();
gtk_editable_init_delegate (GTK_EDITABLE (spin_button));
return;
spin->orientation = orientation;
- _gtk_orientable_set_style_classes (GTK_ORIENTABLE (spin));
+ gtk_widget_update_orientation (GTK_WIDGET (spin), spin->orientation);
/* change alignment if it's the default */
if (spin->orientation == GTK_ORIENTATION_VERTICAL &&
#include "gtkapplicationprivate.h"
#include "gtkbuildable.h"
#include "gtkbuilderprivate.h"
+#include "gtkconstraint.h"
#include "gtkcssboxesprivate.h"
#include "gtkcssfiltervalueprivate.h"
#include "gtkcsstransformvalueprivate.h"
#include "gtklayoutmanagerprivate.h"
#include "gtkmain.h"
#include "gtkmarshalers.h"
+#include "gtknativeprivate.h"
#include "gtkpopover.h"
#include "gtkprivate.h"
#include "gtkrenderbackgroundprivate.h"
#include "gtkrenderborderprivate.h"
#include "gtkrootprivate.h"
-#include "gtknativeprivate.h"
#include "gtkscrollable.h"
#include "gtksettingsprivate.h"
#include "gtkshortcut.h"
#include "gtkwidgetpaintableprivate.h"
#include "gtkwindowgroup.h"
#include "gtkwindowprivate.h"
-#include "gtknativeprivate.h"
-#include "gtkconstraint.h"
#include "a11y/gtkwidgetaccessibleprivate.h"
#include "inspector/window.h"
gtk_css_node_set_classes (priv->cssnode, classes);
g_object_notify_by_pspec (G_OBJECT (widget), widget_props[PROP_CSS_CLASSES]);
}
+
+/*< private >
+ * gtk_widget_update_orientation:
+ * @widget: a #GtkWidget implementing #GtkOrientable
+ * @orientation: the orientation
+ *
+ * Update the internal state associated to the given @orientation of a
+ * #GtkWidget.
+ */
+void
+gtk_widget_update_orientation (GtkWidget *widget,
+ GtkOrientation orientation)
+{
+ g_return_if_fail (GTK_IS_WIDGET (widget));
+
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_HORIZONTAL);
+ gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_VERTICAL);
+ }
+ else
+ {
+ gtk_widget_add_css_class (widget, GTK_STYLE_CLASS_VERTICAL);
+ gtk_widget_remove_css_class (widget, GTK_STYLE_CLASS_HORIZONTAL);
+ }
+}
gboolean gtk_widget_focus_self (GtkWidget *widget,
GtkDirectionType direction);
+void gtk_widget_update_orientation (GtkWidget *widget,
+ GtkOrientation orientation);
+
/* inline getters */
static inline GtkWidget *